"use client"; import styles from "./info.module.css"; import { useState } from "react"; import { fetch_video_link } from "../videoLinkfetcher"; import { MediaPlayer, MediaProvider } from "@vidstack/react"; import "@vidstack/react/player/styles/base.css"; import "@vidstack/react/player/styles/plyr/theme.css"; import { PlyrLayout, plyrLayoutIcons, } from "@vidstack/react/player/layouts/plyr"; import { storeLocal } from "../history/storeData"; export default function Button({ data2: info }) { const currentDate = new Date(); const [videoLink, setVideoLink] = useState(null); async function video(id) { const link = await fetch_video_link(id); if (link === undefined) { alert("Sorry, but not links were found"); } else { setVideoLink(link); } } function store_to_local(name, image, episode, id) { let newData = { name: name, image: image, episode: episode, id: id, type: "anime", date: `${currentDate.getDate()}-${String( currentDate.getMonth() + 1 ).padStart(2, "0")}`, time: `${currentDate.getHours()}:${String( currentDate.getMinutes() ).padStart(2, "0")}`, }; storeLocal(newData); } return (

Episodes:

{info && info.episodes && info.episodes.map((item, index) => ( ))}
{videoLink && ( )}
); }